local shengdunhuanglin = fk.CreateSkill {
    name = "shengdunhuanglin",
    tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["shengdunhuanglin"] = "圣盾",
  [":shengdunhuanglin"] = "锁定技，当其他角色受到伤害时，你可以替其承受该伤害",

  ["#shengdunhuanglin-ask"] = "你可以将 %dest 受到的伤害转移给你",
}

shengdunhuanglin:addEffect(fk.DamageInflicted, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return
      player:hasSkill(shengdunhuanglin.name) and
      target ~= player and
      player:isAlive()
  end,
    on_cost = function(self, event, target, player, data)
    return player.room:askToSkillInvoke(player, self.name, "#shengdunhuanglin-ask", true)
  end,
  on_use = function(self, event, target, player, data)
    local skillName = shengdunhuanglin.name
    local room = player.room
    room:doIndicate(player, { target })
    local damage = data.damage
    data:preventDamage()
    if player:isAlive() then
      room:damage{
        from = data.from,
        to = player,
        damage = damage,
        damageType = data.damageType,
        skillName = skillName,
        card = data.card,
      }
    end
  end,
})

return shengdunhuanglin
